package com.kust.smarthome.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kust.smarthome.web.dto.UserDto;
import com.kust.smarthome.web.model.User;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface UserMapper extends BaseMapper<User> {

    @Select("select * from user where username=#{username}")
    User findByUsername(String username);

    @Select("select nickname,portrait from user where id=#{userId}")
    UserDto getUserInfo(Integer userId);
}
